import axios from "~/axios";

// 查询列表
export function tableList(pageIndex, pageSize, params) {
  return axios.get('/api/admin/product/spec/list/' + pageIndex + '/' + pageSize, {
    params: params
  });
}

// 通过id查询用户信息
export function getSpecInfo(id) {
  return axios.get('/api/admin/product/spec/info/' + id);
}

// 新增或修改
export function saveOrUpdate(formData) {
  let url = ''
  if(formData.id === 0) {
    url = 'save'
  } else {
    url = 'update'
  }
  return axios.post('/api/admin/product/spec/' + url, formData);
}

// 批量删除
export function removeSpec(id) {
  return axios.post('/api/admin/product/spec/remove/' + id);
}

// 批量删除
export function removeSpecDetail(id) {
  return axios.post('/api/admin/product/spec/removeDetail/' + id);
}
